﻿<!DOCTYPE html>
<html>
<head>
<title>Ext Spec Example Specifications</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="libraries/jasmine/jasmine.css" rel="stylesheet" type="text/css" />
<script src="libraries/jasmine/jasmine.js" type="text/javascript"></script>
<script src="libraries/jasmine/jasmine-html.js" type="text/javascript"></script>
<script src="libraries/jasmine/boot.js" type="text/javascript"></script>
<script src="libraries/extspec/ExtSpec.js" type="text/javascript"></script>
<script type="text/javascript">
/*globals jasmine*/

(function () {
    'use strict';

    var classPath;

    function getClassPath() {
        var className = window.location.hash,
            cookiePattern;

        if (className.length > 1) {
            className = className.slice(1);
            document.cookie = 'className=' + className;
        } else {
            cookiePattern = new RegExp('(?:^|.*;\\s*)className\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*');
            className = window.unescape(document.cookie.replace(cookiePattern, "$1"));

            if (!className) {
                throw new Error('The hash was not valid.');
            }
        }

        return className.replace(/\./g, '/');
    }

    function appendScript(source) {
        var script = document.createElement('script');
        script.setAttribute('src', source);
        document.head.appendChild(script);
    }

    classPath = getClassPath();

    appendScript('specifications/' + classPath + '-fakes.js');
    appendScript('app/' + classPath + '.js');
    appendScript('specifications/' + classPath + '-unit.js');
}());
</script>
</head>
<body>
</body>
</html>